package com.breaktian.assemble.eventbus;

import org.greenrobot.eventbus.EventBus;

/**
 * Created by breaktian on 2016/10/26.
 */

public class EventHelper {

    private static EventHelper instance;
    private final EventBus enentBus;




    private EventHelper(){
        enentBus = EventBus.getDefault();
    }

    public static EventHelper get(){
        if(instance==null){
            synchronized (EventHelper.class){
                if(instance==null){
                    instance = new EventHelper();
                }
            }
        }
        return instance;
    }

    /**
     * 注册
     * */
    public void register(Object object){
        enentBus.register(object);
    }

    /**
     * 反注册
     * */
    public void unregister(Object object){
        enentBus.unregister(object);

    }

    public void post(Object event){
        enentBus.post(event);
    }






}
